//just for test
import { NavMenu } from "@/models";
import { defineStore } from "pinia";
const constants={
  'COLLAPSE':'COLLAPSE' 
}
export const useAppStore = defineStore("app", {
  state: () => {
    return {
      navBar: [],
      collapse:localStorage.getItem(constants.COLLAPSE)==='true'
    };
  },
  getters: {},
  actions: {
    updateNavBar(navBar: NavMenu[]) {
      this.navBar=navBar;
    },
    switchCollapse(collapse:Boolean){
       this.collapse=collapse;
       localStorage.setItem(constants.COLLAPSE,(collapse as Boolean).toString());
    }
  },
});
